#pragma once

#include <windows.h>
#include <atlbase.h>
#include <atlstr.h>

class CWinDebugMonitor
{
public:
	struct DbgBuffer
	{
		DWORD	dwProcessId;
		char	data[4096-sizeof(DWORD)];
	};

public:
	CWinDebugMonitor();
	~CWinDebugMonitor();

public:
	DWORD	Initialize();
	void	Unintialize();
	DWORD	GetOutputString();
	
	DbgBuffer*	GetBuffer()
	{
		return &m_stBuffer;
	}

private:
	HANDLE			m_hDBWinMutex;
	HANDLE			m_hDBMonBuffer;
	HANDLE			m_hEventBufferReady;
	HANDLE			m_hEventDataReady;

	HANDLE			m_hWinDebugMonitorThread;
	BOOL			m_bWinDebugMonStopped;
	DbgBuffer*	m_pDBBuffer;

	DbgBuffer	m_stBuffer;
};
